import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path"
import dts from "vite-plugin-dts"
import cssInjectedByJs from "vite-plugin-css-injected-by-js"

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), dts({"tsconfigPath": "tsconfig.app.json"}), cssInjectedByJs()],
  build: {
    lib: {
      entry: resolve(__dirname, "src/index.ts"),
      name: "CustomInputComponent",
      fileName: "index",
    },
    rollupOptions: {
      external: ['vue'],
      output: {
        globals: {
          vue: 'Vue'
        }
      }
    }
  }
})
